<div class="page-container row">

  	<?php include_partial('sidebar', array('current_page' => 'view')) ?>
  
	<div class="page-content">
		<div class="content">
			<ul class="breadcrumb">
		        <li><p>View Data</p></li>
		        <i class="icon-angle-right"></i>
		        <li><a href='<?php print url_for("view_gas")?>' class="active">Brands</a> </li>
		        <i class="icon-angle-right"></i>
		        <li><a href='<?php print url_for("@location?brand=$brand")?>' class="active"><?php print $brand?></a> </li>
	      	</ul>
	      	
	      	<div class="page-title"> <i class="icon-circle-arrow-left"></i>
				<h3>Locations - <span class="semi-bold"><?php print $brand?></span></h3>
			</div>
		
			<div class='row'>
				<div class="grid simple">
					<div class='grid-body'>
						<div id="map" class="gas-map"></div><br><br>
						<table class="table no-more-tables">
							<thead>
								<tr>
                                    <th width="40%">Location</th>
                                	<th width="20%">Regular</th>
                                	<th width="20%">Midgrade</th>
                                	<th width="20%">Premium</th>
                            	</tr>
                            </thead>
							<tbody>
								<?php $locations = array()?>
								<?php foreach ($gas as $g):?>
									<tr>
										<td valign="middle"><a href='<?php print url_for("@price?brand=".html_entity_decode($brand)."&address=".html_entity_decode($g['address']))?>'><?php print $g['address']?></a></td>
										<td valign="middle">
											<?php if(!is_null($g['regular'])):?>
											<?php print $g['regular']?>
											<div class="progress" >
												<div class="progress-bar progress-bar-success animate-progress-bar" data-percentage="<?php print ($g['regular']/5*100)?>%" ></div>
											</div>
											<?php endif?>
										</td>
										<td valign="middle">
											<?php if(!is_null($g['midgrade'])):?>
											<?php print $g['midgrade']?>
											<div class="progress" >
												<div class="progress-bar progress-bar-info animate-progress-bar" data-percentage="<?php print ($g['midgrade']/5*100)?>%" ></div>
											</div>
											<?php endif?>
										</td>
										<td valign="middle">
											<?php if(!is_null($g['premium'])):?>
											<?php print $g['premium']?>
											<div class="progress" >
												<div class="progress-bar progress-bar-warning animate-progress-bar" data-percentage="<?php print ($g['premium']/5*100)?>%" ></div>
											</div>
											<?php endif?>
										</td>
									</tr>
									<?php $locations[] = $g['address'] . ",Chicago IL" ?>
								<?php endforeach;?>
							</tbody>
						</table>
						
					</div>
				</div>
			</div>
			
		</div>
	</div>
</div>

<script type='text/javascript'>
<?php 
	$js_locations = json_encode($locations);
	print "var js_locations = ".$js_locations.";\n";
?>
</script>